package com.collection.provider.biz;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.collection.api.entity.sys.SysUser;
import com.collection.provider.business.dao.sys.SysUserMapper;

@Service
public class SysUserBiz {

	@Autowired
	private SysUserMapper sysUserMapper;
	
	public int deleteByPrimaryKey(Integer id){
		return sysUserMapper.deleteByPrimaryKey(id);
	}

    public int insert(SysUser record){
    	return sysUserMapper.insert(record);
    }

    public int insertSelective(SysUser record){
    	return sysUserMapper.insertSelective(record);
    }

    public SysUser selectByPrimaryKey(Integer id){
    	return sysUserMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(SysUser record){
    	return sysUserMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(SysUser record){
    	return sysUserMapper.updateByPrimaryKey(record);
    }
    
    /**
     * 根据用户名查询用户信息
     */
    public SysUser findByUserName(String userName,Integer appId){
    	return sysUserMapper.findByUserName(userName, appId);
    }
    
    /**
     * 功能描述:通过条件查找用户列表
     */
    public List<Map<String, Object>> findUserList(Map<String,Object> map){
    	return sysUserMapper.findUserList(map);
    }
    /**
     * 功能描述:通过条件统计用户数目
     */
    public int countUserList(Map<String,Object> map){
    	return sysUserMapper.countUserList(map);
    }
    /**
     * 功能描述:通过手机号统计用户数目
     */
    public int countUserByMobile(String mobile){
    	return sysUserMapper.countUserByMobile(mobile);
    }
    /**
     * 功能描述:锁定用户
     */
    public int lockedUser(Integer id){
    	return sysUserMapper.lockedUser(id);
    }
    /**
     * 功能描述:解锁用户
     */
    public int openUser(Integer id){
    	return sysUserMapper.openUser(id);
    }
    /**
     * 功能描述:条件查询所有用户信息
     */
    public List<SysUser> getUserByParam(Map<String, Object> map){
    	return sysUserMapper.getUserByParam(map);
    }
}
